package jcombobox;

import javax.swing.JComboBox;

import javax.swing.JComboBox;
import javax.swing.JFrame;

public class AddItemToComboBox {

  public static void main(String[] a) {
    JFrame frame = new JFrame();
    String labels[] = { "A", "B", "C", "D", "E", "F" };
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JComboBox jComboBox1 = new JComboBox(labels);
    jComboBox1.addItem("asdf");
    
    jComboBox1.insertItemAt("Select a table", 0);

    jComboBox1.addItem("Selle");
    
    Object cmboitem = jComboBox1.getSelectedItem();
    System.out.println(cmboitem);

    frame.add(jComboBox1);

    frame.setSize(300, 200);
    frame.setVisible(true);
  }

} 

